import request from '@/utils/request'

// 查询区域列表（分页）
export function listDistrict(query) {
  return request({
    url: '/house/district/list',
    method: 'get',
    params: query
  })
}

// 查询区域列表（不分页，用于下拉选择）
export function listDistrictOptions(query) {
  return request({
    url: '/house/district/list',
    method: 'get',
    params: {
      ...query,
      pageSize: 999
    }
  })
}

// 查询区域详细
export function getDistrict(districtId) {
  return request({
    url: '/house/district/' + districtId,
    method: 'get'
  })
}

// 新增区域
export function addDistrict(data) {
  return request({
    url: '/house/district',
    method: 'post',
    data: data
  })
}

// 修改区域
export function updateDistrict(data) {
  return request({
    url: '/house/district',
    method: 'put',
    data: data
  })
}

// 删除区域
export function delDistrict(districtId) {
  return request({
    url: '/house/district/' + districtId,
    method: 'delete'
  })
} 